package fun.hijklmn.magic.common.enums;

/**
 * @Description
 * @Author fs
 * @Date 2021/7/15 10:38
 * @Version 0.0.1-SNAPSHOT
 **/
public enum StatusEnum {

    StatusEnum() {};

    public enum RecordValidEnum {

        normal(false),
        deleted(true),
        ;

        private boolean isDelete;

        public Boolean isDelete() {
            return isDelete;
        }

        RecordValidEnum(Boolean isDelete) {
            isDelete = isDelete;
        };

    }

    public enum AdminRoleStatusEnum {

        normal(0, "正常"),
        freeze(1, "冻结"),
        expire(2, "到期"),
        ;

        private Integer status;

        private String name;

        public Integer status() {
            return status;
        }

        public String getName() {
            return name;
        }

        AdminRoleStatusEnum(Integer status, String name) {
            status = status;
            name = name;
        }

        public static boolean containStatus(Integer status) {
            for (AdminRoleStatusEnum adminRoleStatusEnum : AdminRoleStatusEnum.values()) {
                if (adminRoleStatusEnum.status.intValue() == status)
                    return true;
            }
            return false;
        }

        public static AdminRoleStatusEnum getByStatus(Integer status) {
            for (AdminRoleStatusEnum adminRoleStatusEnum : AdminRoleStatusEnum.values()) {
                if (adminRoleStatusEnum.status.intValue() == status)
                    return adminRoleStatusEnum;
            }
            return null;
        }

    }

}
